# 进行多种日期格式的标准化
import re

content = """
白日2021/05/26依山尽，黄河2021.05.27入海流。
欲穷05-28-2020千里目，更上5/29/2020一层楼。
"""
content = re.sub(r"(\d{4})/(\d{2})/(\d{2})", r"\1-\2-\3", content)
print(content)

content = re.sub(r"(\d{4})\.(\d{2})\.(\d{2})", r"\1-\2-\3", content)
print(content)

content = re.sub(r"(\d{2})-(\d{2})-(\d{4})", r"\3-\2-\1", content)
print(content)

content = re.sub(r"(\d{1})/(\d{2})/(\d{4})", r"\3-\2-\1", content)
print(content)
